package com.cqupt.qualityevaluation.controller;

import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.cqupt.qualityevaluation.dao.schooluserMapper;
import com.cqupt.qualityevaluation.pojo.schooluser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/schooltask")
public class TaskResController {
    @Autowired
    schooluserMapper schooluserMapper;

    /**
     * 更新提交结果到info字段
     * @param user
     * @return
     */
    @PostMapping("/respost")
    public String taskResPost(@RequestBody schooluser user){
//        System.out.println(user);
        UpdateWrapper<schooluser> updateWrapper = new UpdateWrapper<>();
        updateWrapper.eq("id",user.getId());
        schooluser schooluser = new schooluser();
        schooluser.setInfo(user.getInfo());
        int updateRes = schooluserMapper.update(schooluser, updateWrapper);
//        System.out.println("结果"+updateRes);
        return "success";
    }

}
